//
// Created by bjliuyong on 2021/7/13.
//

#ifndef JVM_INSTANCEKLASS_H
#define JVM_INSTANCEKLASS_H

#include "oops/klass.h"
#include "oops/method.h"
#include "utilities/array.h"
#include "oops/constantPool.h"


class InstanceKlass : public Klass {

protected:
  // Constant pool for this class.
ConstantPool* _constants;

u2              _this_class_index;              // constant pool entry
Array<Method*>* _methods;
  
public:
 // constant pool
  ConstantPool* constants() const        { return _constants; }
  void set_constants(ConstantPool* c)    { _constants = c; }

  // this class cp index
  u2 this_class_index() const             { return _this_class_index; }
  void set_this_class_index(u2 index)     { _this_class_index = index; }

  void set_methods(Array<Method*>* methods) {_methods = methods;}
  Array<Method*>* methods() {return _methods;}
};

#endif //JVM_INSTANCEKLASS_H
